﻿using System;
using System.Collections.Generic;
using Wala.Connection.Objects.Contacts;
using Wala.Connection.HttpsConnections;
using System.Threading.Tasks;
using Wala.Infrastructure;

namespace Wala.Connection.Managements
{
    public class ContactManager
    {
        /// <summary>
        /// Get RetContactBasic
        /// </summary>
        /// <returns></returns>
        public async static Task<RetContactBasic> GetRetContactBasic()
        {
            string url = URLConstant.HOST_SECURE + URLConstant.GET_CONTACT_BASIC;
            string result = await ClientHttpsRequest.HttpsRequestWithCookie(url);
            RetContactBasic retContact = RetContactBasic.FromJson(result);
            return retContact;
        }

        /// <summary>
        /// Get list of contact basic
        /// </summary>
        /// <returns></returns>
        public async static Task<List<ContactBasic>> GetContactBasicList()
        {
            string url = URLConstant.HOST_SECURE + URLConstant.GET_CONTACT_BASIC;
            string result = await ClientHttpsRequest.HttpsRequestWithCookie(url);
            RetContactBasic retContact = RetContactBasic.FromJson(result);
            return retContact.User_basics;
        }
    }
}
